#include <QtGui/QApplication>
#include "mainwindow.h"
#include "mainmenu.h"
#include "setupwindow.h"
#include "player.h"



int main(int argc, char *argv[])
{
    QApplication a(argc, argv);
    MainMenu mainMenu;
    SetupWindow setupWindow;
    MainWindow mainWindow;

    //Connecting signals and slots between windows

    //connect mainmenu and setupwindow
    QObject::connect(&mainMenu, SIGNAL(doneSelecting(QString,QString,QString)), &setupWindow, SLOT(on_doneSelecting(QString,QString,QString)));
    QObject::connect(&setupWindow, SIGNAL(playerFired()), &setupWindow, SLOT(on_playerFired()));
    QObject::connect(&setupWindow, SIGNAL(newGame()), &mainMenu, SLOT(on_newGame()));
    QObject::connect(&setupWindow, SIGNAL(shipSunk(QString,QString,QString)), &setupWindow, SLOT(on_shipSunk(QString,QString,QString)));
    QObject::connect(&setupWindow, SIGNAL(playerWon(QString)), &setupWindow, SLOT(on_playerWon(QString)));

    mainMenu.show();
//    setupWindow.show();
//    mainWindow.show();
//    w.show();
//    Player newplayer = new Player(this);
//    QObject::connect(&mainWindow, SIGNAL(my))

    return a.exec();
}
